#ifndef STRATEGY_H
#define STRATEGY_H
#include<functional>
#include "player.h"
#include"playhand.h"
#include"cards.h"
#include"card.h"
class Strategy
{
public:
    Cards firstPlay();
    Cards getGreaterCards(PlayHand type);
    bool whetherToBeat(Cards &cards);
    Cards makeStrategy();
    Strategy(Player *player, Cards &cards);
    Strategy();
    Cards findSamePointCards(Card::CardPoint point,int count);
    QVector<Cards> findCardsBycount(int count);
    Cards getRangeCards(Card::CardPoint begin,Card::CardPoint end);
    QVector<Cards> findCardType(PlayHand playhand,bool beat);
    void pickSeqSingles(QVector<QVector<Cards>> &allSeqRecord,const QVector<Cards> &seqSingle,Cards &cards);
    QVector<Cards> pickOptimalSeqSingles();

private:
    using funciton1 = Cards (Strategy::*)(Card::CardPoint point);
    struct CardInfo{
        Card::CardPoint begin;
        Card::CardPoint end;
        int extra;
        bool beat;
        int number;
        int base;
        funciton1 getSeq;
    };
    QVector<Cards> getCards(Card::CardPoint point,int numble);
    QVector<Cards> getTripleSingleOrPair(Card::CardPoint begin , PlayHand::HandType type);
    QVector<Cards> getplane(Card::CardPoint begin);
    QVector<Cards> getplane2SingleOr2Pair(Card::CardPoint begin , PlayHand::HandType type);
    QVector<Cards> getSeqPairOrSeqSingle(CardInfo &info);
    Cards getBaseSeqPair(Card::CardPoint point);
    Cards getBaseSeqSingle(Card::CardPoint point);
    QVector<Cards> getBomb(Card::CardPoint begin);

private:
    Cards m_cards;
    Player *m_player;
};

#endif // STRATEGY_H
